sentence get first second word php laravel

64

laravel get first letter of each word -

$words = explode(" ", "Community College District");
$acronym = "";

foreach ($words as $w) {
  $acronym .= $w[0];
}

Comments

Submit
0 Comments